package chixing.day07.inherited;
public class EmployeeTest {
    public static void main(String[] args) {
        Employee employeea = new Employee();
        employeea.work();

        Employee emp1 =  new Employee();
        Manager manager1 = new Manager();


        // 父类引用子类对象
        Employee emp2 = new Manager();  // ok

        Manager manager2 = manager1;
        Employee emp3 = manager2;

        //  Manager manager3 = new Employee();  // error

        Manager manager4 =(Manager) emp3; // 编译ok， 运行ok

        //为了防止出现 类型转换异常 ClassCastException
        if(emp1 instanceof  Manager   ) {  // 判断 emp1 是不是Manager 类型
            Manager manager5 = (Manager) emp1;  // 编译ok，运行 出错
        }



        int[] arr1 = new int[5];  // {0,0,0,0,0}
        boolean[] arr2 = new boolean[3]; // {false,false,false}

        Employee[] empArr = new Employee[3]; // {null,null,null}
        Employee employee1 =  new Employee();
        Employee employee2 =  new Employee();
        Employee employee3 =  new Employee();

        empArr[0] = employee1;
        empArr[1] = employee2;

        empArr[2] =  new Manager();
        Manager manager6 = new Manager();
        empArr[2] =  manager6;


        fun1(189439043L);
        fun1(10);
        fun2(employee1);
        fun2(manager6);

        fun3(manager6);
        fun3(manager4);
    }

    public static  void fun1(long a){ // long a = 10(int)

    }

    public static  void fun2(Employee emp){ // Employee emp =  employee1

    }

    public static  void fun3(Manager manager){ //

    }
    Employee  employee1 = new Employee();


}
